import request from "@/utils/request";

export function getAllChapter(courseId) {
  return request({
    url: `/admin/eduChapter/getAllChapter/${courseId}`,
    method: "get"
  });
}

export function save(chapter) {
  return request({
    url: `/admin/eduChapter/save`,
    method: "post",
    data: chapter
  });
}

export function removeById(chapterId) {
  return request({
    url: `/admin/eduChapter/remove/${chapterId}`,
    method: "delete"
  });
}

export function getById(chapterId) {
  return request({
    url: `/admin/eduChapter/get/${chapterId}`,
    method: "get"
  });
}

export function updateById(chapter) {
  return request({
    url: `/admin/eduChapter/update`,
    method: "put",
    data: chapter
  });
}
